package com.itfreer.gis.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Index;
import javax.persistence.Table;

import org.springframework.beans.BeanUtils;

import com.itfreer.form.api.JdbcBaseEntity;
import com.itfreer.gis.entity.GisBookEntity;

/**
 * 书签定位功能
 */
@Entity(name = "gis_book")
@Table(indexes = { 
        @Index(name="g_b_userid", columnList="s_userid"),
        @Index(name="g_b_registerService", columnList="s_registerService") })
public class JdbcGisBookEntity implements JdbcBaseEntity<GisBookEntity>, Serializable {

	private static final long serialVersionUID = 8956058710867750399L;

	/**
	 * GUID
	 */
	@Id
	@Column(name = "id", length = 50, nullable = false)
	private String id;

	/**
	 * 名称
	 */
	@Column(name = "s_bookname", nullable = true)
	private String bookname;
	
	/**
	 * 范围
	 */
	@Column(name = "s_bookextent", nullable = true)
	private String bookextent;
	
	/**
	 * 用户ID
	 */
	@Column(name = "s_userid", nullable = true)
	private String userid;
	
	/**
	 * 所属应用程序
	 */
	@Column(name = "s_registerService", nullable = true)
	private String registerService;
	
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getBookname() {
		return bookname;
	}

	public void setBookname(String bookname) {
		this.bookname = bookname;
	}

	public String getBookextent() {
		return bookextent;
	}

	public void setBookextent(String bookextent) {
		this.bookextent = bookextent;
	}

	public String getUserid() {
		return userid;
	}

	public void setUserid(String userid) {
		this.userid = userid;
	}

	public String getRegisterService() {
		return registerService;
	}

	public void setRegisterService(String registerService) {
		this.registerService = registerService;
	}

	@Override
	public void from(GisBookEntity t) {
		BeanUtils.copyProperties(t, this);
	}

	@Override
	public GisBookEntity toEntity() {
		GisBookEntity toEntity = new GisBookEntity();
		BeanUtils.copyProperties(this, toEntity);
		return toEntity;
	}
}